﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ERF;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace FirstPerson.Objects
{
    /// <summary>
    /// Represents a line. Used for debugging purposes.
    /// </summary>
    class Line : GeometricGameObject
    {
        public Line(ERFGame game, Vector3 start, Vector3 end) : base(game)
        {
            base.Vertices = new Microsoft.Xna.Framework.Graphics.VertexPositionNormalTexture[]{
                new VertexPositionNormalTexture(start, Vector3.Up, Vector2.Zero),
                new VertexPositionNormalTexture(end, Vector3.Up, Vector2.One)
            };

            base.Indices = new ushort[] {
                0, 1
            };

            base.PrimitiveType = PrimitiveType.LineList;
            base.primitiveCount = 1;

            BasicShaderEffect effect = new BasicShaderEffect(game);
            effect.EnableLight = false;
            effect.EnableTexture = false;
            effect.EnableSpecularMap = false;
            effect.DiffuseColor = Color.Red.ToVector3();
            base.effect = effect;
            
        }
    }
}
